Ratchet is an AI-powered CLI that scores, fixes, and tests your code automatically — one committed improvement at a time.
How It Works
Ratchet automates the tedious parts of code improvement so you can focus on building.
Get an instant quality score across 6 dimensions — security, testing, type safety, performance, and more.
Let AI apply fixes automatically. It analyzes, proposes, builds, and tests each change before committing.
Your quality score climbs with every successful fix. If a change breaks tests, The Pawl instantly reverts it.
The Core Mechanic
A ratchet only turns one way. Each click advances the socket — it can never slip back. Ratchet works the same way on your code.
The Pawl is Ratchet's anti-rollback mechanism. Every proposed change runs your full test suite before it commits. If tests fail, the change is automatically reverted and the click doesn't count.
The result: a branch of commits that only ever moves forward. Every merged click is a proven improvement — no exceptions.
Commands
Ratchet covers the full improvement lifecycle — from scoring where you stand, to autonomously fixing what needs fixing, to visualizing the big picture.
Get an objective quality score across six dimensions — code quality, testing, security, error handling, performance, and type safety. Works on any language, any size project. Run it locally or pipe the JSON output to your own dashboards.
ratchet scanThe main loop. Ratchet reads your codebase, identifies the highest-impact fix available, applies it, runs your test suite, and only commits if everything passes. Give it 7 clicks and watch your score climb. Failed tests mean zero regression — the bad click simply vanishes.
ratchet torque --clicks 7Targeted single-file or single-function fixes without spinning up a full torque session. Perfect for addressing that one function your code review flagged, or patching a security issue before it reaches production.
ratchet improve --file auth.tsGenerate a self-contained interactive HTML dependency graph — every file, every import, color-coded by health and sized by blast radius. Find circular dependencies, identify oversized modules, and get a spatial sense of your codebase at a glance.
ratchet vision --openStop guessing what "clean code" means on your project. Ratchet produces an objective, reproducible quality score across every dimension that matters for production systems.
Run it before a sprint to find your biggest risks. Run it after torque to measure progress. Track it over time to prove your codebase is improving.
Run ratchet vision --open and get a self-contained HTML file: an interactive force-directed graph of every file and dependency in your project.
Nodes glow green when healthy, amber when there are issues, red when critical. Node size reflects blast radius — the larger it is, the more your codebase depends on it.
Generated as a single HTML file. No server, no npm, no build step. Open in any browser.
FAQ
Everything you need to know before you start.
ratchet scan --fail-on 80 and Ratchet exits non-zero if your score drops below the threshold. A GitHub Action is available on the Team plan for first-class pipeline integration.
Pricing
Start free. Level up when your codebase demands it.
Need more cycles? $0.75/cycle on any paid plan.